﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FileSearchPerf
{
    public class Program
    {
        private static Stopwatch watch = new Stopwatch();

        private static string fileName = "abcdefg";

        public static void Main(string[] args)
        {
            watch.Start();

            string[] files = Directory.GetFiles(@"D:\1", fileName, SearchOption.AllDirectories);

            if (files.Length != 1)
            {
                throw new FileNotFoundException();
            }

            watch.Stop();

            Console.WriteLine(watch.Elapsed);
            Console.ReadLine();
        }
    }
}
